//
//  Associate_OneViewController.m
//  O2O Product
//
//  Created by 特沃兹 on 2017/12/30.
//  Copyright © 2017年 Product Author. All rights reserved.
//

#import "Associate_OneViewController.h"

@interface Associate_OneViewController ()

@end

@implementation Associate_OneViewController

#pragma mark - ---------- Lazy Loading（懒加载） ----------
-(UIImageView *)logoimage{
    if (_logoimage == nil) {
        _logoimage = [[UIImageView alloc]init];
        _logoimage.backgroundColor = [UIColor grayColor];
    }
    return _logoimage;
}
-(UILabel *)AssociateLabe{
    if (_AssociateLabe ==  nil) {
        _AssociateLabe = [[UILabel alloc]init];
        _AssociateLabe.text = @"亲爱的用户*****为了给您更好的用户体验，请关联一个账号!";
        _AssociateLabe.textColor = Color_333333;
        _AssociateLabe.numberOfLines = 0;

    }
    return _AssociateLabe;
}
-(UILabel *)AssociateLabe_1{
    if (_AssociateLabe_1 == nil) {
        _AssociateLabe_1 = [[UILabel alloc]init];
        _AssociateLabe_1.text = @"已用***账号？";
        _AssociateLabe_1.textColor = Color_333333;
    }
    return _AssociateLabe_1;
}
-(UILabel *)AssociateLabe_2{
    if (_AssociateLabe_2 == nil) {
        _AssociateLabe_2 = [[UILabel alloc]init];
        _AssociateLabe_2.text = @"还没有***账号？";
        _AssociateLabe_2.textColor = Color_333333;
    }
    return _AssociateLabe_2;
}
-(UIButton *)AssociateButton_1{
    if (_AssociateButton_1 == nil) {
        _AssociateButton_1 = [UIButton  buttonWithType:UIButtonTypeCustom];
        [_AssociateButton_1 setBackgroundColor:Color_d73b3c];
        [_AssociateButton_1 setTitle:@"立即关联" forState:UIControlStateNormal];
        [_AssociateButton_1.layer setCornerRadius:2];
        [_AssociateButton_1 addTarget:self action:@selector(AssociateAction) forControlEvents:UIControlEventTouchUpInside];
    }
    return _AssociateButton_1;
}
-(UIButton *)AssociateButton_2{
    if (_AssociateButton_2 == nil) {
        _AssociateButton_2 = [UIButton  buttonWithType:UIButtonTypeCustom];
        [_AssociateButton_2 setTitle:@"快速注册" forState:UIControlStateNormal];
        [_AssociateButton_2 setTitleColor:Color_d73b3c forState:UIControlStateNormal];
        [_AssociateButton_2.layer setCornerRadius:2];
        [_AssociateButton_2.layer setBorderWidth:1];
        [_AssociateButton_2.layer setBorderColor:Color_d73b3c.CGColor];
        [_AssociateButton_2 addTarget:self action:@selector(Associate2Action) forControlEvents:UIControlEventTouchUpInside];
    }
    return _AssociateButton_2;
}
#pragma mark - ----------   Lifecycle（生命周期） ----------
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view setBackgroundColor:[UIColor whiteColor]];
    [self InitSubView];
}
#pragma mark - ---------- Private Methods（私有方法） ----------

#pragma mark initliaze data(初始化数据)

#pragma mark config control（布局控件）
-(void)InitSubView{
    [self.view addSubview:self.logoimage];
    [self.logoimage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_offset(0);
        make.top.mas_offset(TopBarHeight+30);
        make.size.mas_offset(CGSizeMake(80, 80));
    }];
    [self.view addSubview:self.AssociateLabe];
    [self.AssociateLabe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.logoimage.mas_bottom).offset(10);
        make.centerX.mas_offset(0);
        make.size.mas_offset(CGSizeMake(150, 70));
    }];
    [self.view addSubview:self.AssociateLabe_1];
    [self.AssociateLabe_1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.top.equalTo(self.AssociateLabe.mas_bottom).offset(20);
        make.size.mas_offset(CGSizeMake(200, 30));
    }];
    [self.view addSubview:self.AssociateButton_1];
    [self.AssociateButton_1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.AssociateLabe_1.mas_bottom).offset(10);
        make.centerX.mas_offset(0);
        make.size.mas_offset(CGSizeMake(Main_Screen_Width-40, 50));
    }];
    [self.view addSubview:self.AssociateLabe_2];
    [self.AssociateLabe_2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.top.equalTo(self.AssociateButton_1.mas_bottom).offset(20);
        make.size.mas_offset(CGSizeMake(200, 30));
    }];
    [self.view addSubview:self.AssociateButton_2];
    [self.AssociateButton_2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.AssociateLabe_2.mas_bottom).offset(10);
        make.centerX.mas_offset(0);
        make.size.mas_offset(CGSizeMake(Main_Screen_Width-40, 50));
    }];
}
#pragma mark networkRequest (网络请求)



#pragma mark IBActions （点击事件xib）
//立即关联
-(void)AssociateAction{
    [self presentViewController:[Associate_TwoViewController new] animated:YES completion:nil];
}
//快速注册
-(void)Associate2Action{
    [self presentViewController:[RegisteredViewController new] animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
